complete assignment 1 - #1
Open
YariShukla wants to merge 3 commits into
Open
Conversation
KasraVakiloroayaei
suggested changes
Sep 1, 2026
Owner
Author
|
Hi @KasraVakiloroayaei I have updated assignment_1.ipynb with the complete solutions and output cells for both Part 1 and Part 2. Could you please re-review when you have a moment? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
I added the
anagram_checkerfunction for Assignment #1. The function checks whether two strings are anagrams of each other. I also added theis_case_sensitiveoption to allow the function to either consider or ignore capitalization.What did you learn from the changes you have made?
I learned how to work with Python functions, strings, conditional statements, and the
sorted()function. I also learned how changing the case of strings affects comparisons and how to use a boolean parameter to control the behaviour of a function.Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
I considered comparing the characters in the two words using a different approach, such as counting how many times each character appears. I decided to use
sorted()because it provides a simple and concise way to compare the characters in two strings.Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
One challenge was understanding how to handle uppercase and lowercase letters depending on the
is_case_sensitiveoption. I overcame this by converting both strings to lowercase when case sensitivity is turned off, while leaving the strings unchanged when case sensitivity is turned on.How were these changes tested?
I tested the function in JupyterLab using the examples provided in the assignment. I tested both case-sensitive and case-insensitive comparisons, including:
anagram_checker("Silent", "listen", False)→Trueanagram_checker("Silent", "listen", True)→Falseanagram_checker("Silent", "Listen", True)→Falseanagram_checker("Silent", "Night", False)→Falseanagram_checker("night", "Thing", False)→TrueAll test cases executed successfully without errors.
A reference to a related issue in your repository (if applicable)
Not applicable.
Checklist